package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.FertilizerConsumeMapper;
import com.ruoyi.consume.domain.FertilizerConsume;
import com.ruoyi.consume.service.IFertilizerConsumeService;

/**
 * 查看领用信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-23
 */
@Service
public class FertilizerConsumeServiceImpl implements IFertilizerConsumeService
{
    @Autowired
    private FertilizerConsumeMapper fertilizerConsumeMapper;

    /**
     * 查询查看领用信息
     *
     * @param fertilizerConsumeId 查看领用信息ID
     * @return 查看领用信息
     */
    @Override
    public FertilizerConsume selectFertilizerConsumeById(Long fertilizerConsumeId)
    {
        return fertilizerConsumeMapper.selectFertilizerConsumeById(fertilizerConsumeId);
    }

    /**
     * 查询查看领用信息列表
     *
     * @param fertilizerConsume 查看领用信息
     * @return 查看领用信息
     */
    @Override
    public List<FertilizerConsume> selectFertilizerConsumeList(FertilizerConsume fertilizerConsume)
    {
        return fertilizerConsumeMapper.selectFertilizerConsumeList(fertilizerConsume);
    }

    /**
     * 新增查看领用信息
     *
     * @param fertilizerConsume 查看领用信息
     * @return 结果
     */
    @Override
    public int insertFertilizerConsume(FertilizerConsume fertilizerConsume)
    {
        fertilizerConsume.setCreateTime(DateUtils.getNowDate());
        return fertilizerConsumeMapper.insertFertilizerConsume(fertilizerConsume);
    }

    /**
     * 修改查看领用信息
     *
     * @param fertilizerConsume 查看领用信息
     * @return 结果
     */
    @Override
    public int updateFertilizerConsume(FertilizerConsume fertilizerConsume)
    {
        fertilizerConsume.setUpdateTime(DateUtils.getNowDate());
        return fertilizerConsumeMapper.updateFertilizerConsume(fertilizerConsume);
    }

    /**
     * 批量删除查看领用信息
     *
     * @param fertilizerConsumeIds 需要删除的查看领用信息ID
     * @return 结果
     */
    @Override
    public int deleteFertilizerConsumeByIds(Long[] fertilizerConsumeIds)
    {
        return fertilizerConsumeMapper.deleteFertilizerConsumeByIds(fertilizerConsumeIds);
    }

    /**
     * 删除查看领用信息信息
     *
     * @param fertilizerConsumeId 查看领用信息ID
     * @return 结果
     */
    @Override
    public int deleteFertilizerConsumeById(Long fertilizerConsumeId)
    {
        return fertilizerConsumeMapper.deleteFertilizerConsumeById(fertilizerConsumeId);
    }

    /**
     * 获取用户下拉框
     *
     * @param
     * @return 结果
     */
    @Override
    public List<FertilizerConsume> getUserName(){
        return fertilizerConsumeMapper.getUserName();
    }
}
